package com.itheima.service.impl;

import com.itheima.dao.CategoryDao;
import com.itheima.dao.impl.CategoryDaoImpl;
import com.itheima.pojo.Category;
import com.itheima.service.CategoryService;

import java.util.List;

/**
 * @author ZhangYan
 * @Date 2021/1/15
 */
public class CategoryServiceImpl implements CategoryService {

    //创建CategoryDao对象
    private CategoryDao categoryDao = new CategoryDaoImpl();

    @Override
    public List<Category> findAll() {
        //调用Dao层方法
        try {

            List<Category> list = categoryDao.findAll();
            return list;

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
